#include <Eigen/Core>
#include <opencv2/core/eigen.hpp>
#include <opencv2/calib3d.hpp>
#include <iostream>
#include <Eigen/Dense>
#include <ctime>
#include <cstdlib>
#include <math.h>
#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include <fstream>
#include <iomanip>


class LightDescriptor
{
public:
    LightDescriptor(const cv::RotatedRect& light);
    const LightDescriptor& operator =(const LightDescriptor& ld);
    cv::RotatedRect rec() const;
    void draw(cv::Mat img);

public:
    float width;
    float length;
    cv::Point2f center;
    float angle;
    float area;
    cv::Rect brect;
};

class MatchLights
{
public:

    MatchLights(const LightDescriptor& light1,const LightDescriptor& light2);
    const MatchLights& operator =(const MatchLights& ld);
    void draw(cv::Mat img);
    void GetFourPoints(std::vector<cv::Point2f> &fourPoints);
    Eigen::Vector3f PNP(cv::Mat IntrinsicMatrix,cv::Mat coe);

public:
    cv::Point2f A;
    cv::Point2f B;
    cv::Point2f C;
    cv::Point2f D;
    cv::Point2f center;
    double qx;
    double px;
    double ratio;
    double score;
    int situation;
    
};
